package com.supplychainapi.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.List;

@ApiModel("新增修改之前参数获取")
public class BeforeData<T> {
    @ApiModelProperty("是否自动编码")
    private boolean isAuto;

    @ApiModelProperty("编码")
    private String code;

    @ApiModelProperty("更新的话 具体的model")
    private T model;

    @ApiModelProperty("进项销率")
    private List<Rate> inputTaxRate;

    @ApiModelProperty("销项销率")
    private List<Rate> salesTaxRate;

    @ApiModelProperty("计价方法")
    private List<Rate> pricingMethod;


    public boolean isAuto() {
        return isAuto;
    }

    public void setAuto(boolean auto) {
        isAuto = auto;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public T getModel() {
        return model;
    }

    public void setModel(T model) {
        this.model = model;
    }

    public List<Rate> getInputTaxRate() {
        return inputTaxRate;
    }

    public void setInputTaxRate(List<Rate> inputTaxRate) {
        this.inputTaxRate = inputTaxRate;
    }

    public List<Rate> getSalesTaxRate() {
        return salesTaxRate;
    }

    public void setSalesTaxRate(List<Rate> salesTaxRate) {
        this.salesTaxRate = salesTaxRate;
    }

    public List<Rate> getPricingMethod() {
        return pricingMethod;
    }

    public void setPricingMethod(List<Rate> pricingMethod) {
        this.pricingMethod = pricingMethod;
    }


    public BeforeData(boolean isAuto, String code, T model, List<Rate> inputTaxRate, List<Rate> salesTaxRate, List<Rate> pricingMethod) {
        this.isAuto = isAuto;
        this.code = code;
        this.model = model;
        this.inputTaxRate = inputTaxRate;
        this.salesTaxRate = salesTaxRate;
        this.pricingMethod = pricingMethod;
    }

    public BeforeData(boolean isAuto, String code, T model) {
        this.isAuto = isAuto;
        this.code = code;
        this.model = model;

    }



    public static final <TT> BeforeData build(boolean isAuto, String code, TT model, List<Rate> inputTaxRate, List<Rate> salesTaxRate, List<Rate> pricingMethod){
        return new BeforeData(isAuto,code,model,inputTaxRate,salesTaxRate,pricingMethod);
    }

    public static final <TT> BeforeData build(boolean isAuto, String code, TT model){
        return new BeforeData(isAuto,code,model);
    }
}
